﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SunshineAirlineTest1.DataAccess
{
    public static class CommonHelper
    {
        /// <summary>
        /// bind combobox's datasource
        /// </summary>
        public static void BindComboBoxList(ComboBox cb, object dataSource, string valueField, string textField)
        {
            cb.ValueMember = valueField;
            cb.DisplayMember = textField;
            cb.DataSource = dataSource;
            if (dataSource != null) cb.SelectedIndex = 0;
        }
    }
}
